<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<input id="queue-input" type="text">
<p id="queue-cont">队列内容：apple-&gt;pear</p>    
<button id="in-btn" onclick="btn1()">入队</button>
<button id="out-btn">出队</button>
<button id="font-btn">打印队头元素内容</button>
<button id="empty-btn">判断队列是否为空</button>

<script>

var queue = ["apple", "pear"];
function btn1(){
    // queue.unshift('123')
    var x=document.querySelector('#queue-cont').innerText.split('->')
    x.push('123')
    document.querySelector('#queue-cont').innerHTML=x.join('->')
}
</script>
</body>
</html>